<?php

class Db_Tables2_BClientSigner
{
	function __construct() {
		$this->dealers_db = Zend_Registry::get("dealers_db");
	}
	
	function GetClientSigner($client_id)
	{
		$result = array();
		
		$select = $this->dealers_db->select();
		$select->from("b_client_signer as c", array("signer_id"));
		$select->joinLeft("b_signer as s", "s.signer_id=c.signer_id", array("company_name"));
		$select->where("c.client_id = ?", $client_id);
		$select->where("s.status = ?", 1);
		$select->where("c.status = ?", 1);
		$data = $this->dealers_db->fetchAll($select);
		
		if(!empty($data))
		{
			foreach($data as $d)
			{
				$result[$d['signer_id']] = $d['company_name'];
			}
		}
		
		return $result;
	}
}